<?php
namespace app\common;

use think\Model;

class BaseModel extends Model
{
    /**
     * [dataTable description]
     * @param  integer $page  [description]
     * @param  integer $limit [description]
     * @return [type]         [description]
     */
    public static function dataTable($page = 1, $limit = 10, $keyword = '')
    {
        $total  = static::WithKeyword($keyword)->count();
        $rows   = static::WithKeyword($keyword)->page($page, $limit)->select();
        return compact('rows', 'total');
    }
}
